package com.zer0.tga.tile;

import java.util.List;

import com.zer0.tga.art.ArtArchive;
import com.zer0.tga.art.Screen;
import com.zer0.tga.entity.Entity;
import com.zer0.tga.level.Level;
import com.zer0.tga.math.BoundingBox;
import com.zer0.tga.math.BoundingBoxOwner;
import com.zer0.tga.math.Box;
import com.zer0.tga.math.Coordinate;

public class Tile implements BoundingBoxOwner {

    public static final int HEIGHT = 64;
    public static final int WIDTH = 64;

    public Level level;
    public Coordinate c = new Coordinate();
  //  public int image;
	
    public Tile()
    {
    	
    }
	
	public Tile(Level level, int x, int y) {
		// TODO Auto-generated constructor stub
		init(level,x,y);
	}

	@Override
	public void collision(Entity entity, double xa, double ya) {
		// TODO Auto-generated method stub
		
	}
	
	    public int minimapColor;

	    public void init(Level level, int x, int y) {
	        this.level = level;
	        this.c.x = x;
	        this.c.y = y;
	    }

	    public boolean canPass(Entity e) {
	        return true;
	    }

	    public void render(Screen screen) {
	        screen.draw(ArtArchive.grassTile[0][4], c.x * Tile.WIDTH, c.y * Tile.HEIGHT); /*RandNum.getRandNum(0, 1)*/
	    }

	    public void addBoundingBoxToList(List<BoundingBox> list, Entity e) {
	        if (canPass(e))
	        	return;

	        Box b = new Box( c.x * Tile.WIDTH, c.y * Tile.HEIGHT, (c.x + 1) * Tile.WIDTH, (c.y + 1) * Tile.HEIGHT);
	        list.add(new BoundingBox(this,b));
	    }

	    public void handleCollision(Entity entity, double xa, double ya) 
	    {
	    	
	    }

	    public void hurt(Entity e)
	    {
	    	
	    }

		public void setSide(int i) {
			// TODO Auto-generated method stub
			
		}

	}